<?php /* Smarty version 2.6.26, created on 2010-04-29 20:09:04
         compiled from admin_center/add_news_type.html.php */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="<?php echo $this->_tpl_vars['sky_img']; ?>
js/jquery.js"></script>

<script language="javascript">
$(function(){
	  get_editor(<?php echo $this->_tpl_vars['style_counts']; ?>
);
	  $('#add').click(function(){
	  	$('#tables').hide();
	  	$('#layout').animate({ height: 'toggle', opacity: 'toggle' },2000); 
	  });
	  $('#close').click(function(){
	  	$('#tables').show();
	  	$('#layout').hide();
	  	window.location.reload();
	  });
});

function get_editor(counts){
    var a = $('a');
    a.each(function(k){
    var editor_str = '';
    editor_str ='<input type=text name=editor_style id=editor_style'+k+' class =inputclass>&nbsp;&nbsp;<span class=editor_sub>提交</span>';
    
	$('#edit'+k).click(function(){
		$('#style'+k).html(editor_str);
		$('#style'+k).addClass('editor_sty');
		$('#editor_style'+k).val($('#hide'+k).val());
        
		$('.editor_sub').click(function(){
			var sures = confirm('确认修改该分类吗？');
			if(sures ==true){
			$.ajax({
			type:'post',
			url:'editor_style/'+$('#id'+k).val()+'/'+escape($('#editor_style'+k).val()),
			success:function(res){
				window.location.reload();   
				alert(res);
				}
			});}
			else return false;
		});
	});
  });
}
</script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
ul li{ margin:0; padding:0; list-style:none;}
#layout {position:relative; width:99%; height:670px; background:#eeecec; display:none;filter: Alpha(Opacity=30);}

#addtype {width:350px; height:auto; position:absolute; top:160px; left:35%; border:1px solid #c0de98; padding-top:18px; z-index:9999; background:#fff;}

#addtype li { width:350px; height:25px;}
#addtype li label { display:block; width:90px; float:left; line-height:25px; text-align:center; font-size:12px;}
#addtype li .put { float:right; width:260px; height:25px;}
.inputclass {
	height:14px;
	line-height:14px;
	border:solid 1px #cadcb2; 
	font-size:12px; 
	color:#81b432;
}
.editor_sub {
	text-align:center;
	font-size:12px;
	line-height:18px;
	color:#06482a;
	cursor:pointer;
}
.editor_style {
	height:18px;
	line-height:18px;
}
.STYLE1 {font-size: 12px}
.STYLE4 {
	font-size: 12px;
	color: #1F4A65;
	font-weight: bold;
}

a:link {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;

}
a:visited {
	font-size: 12px;
	color: #06482a;
	text-decoration: none;
}
a:hover {
	font-size: 12px;
	color: #FF0000;
	text-decoration: underline;
}
a:active {
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.STYLE7 {font-size: 12}

-->
</style>
</head>

<body>
<div id="layout">
	<div id="addtype">
    <ul>
    	<li>
    	  <label>类型名称：</label>
    	  <div class="put"><input type="text"  class="inputclass"/></div></li>
        <li>
          <label>类型排序：</label><div class="put"><input type="text" class="inputclass"/></div></li>
        <li style="text-align:center; padding-top:10px;"><input type="submit" value="提交" />&nbsp;<input type="reset" value="重置"/>&nbsp;<span id="close" style="cursor:pointer; font-size:12px;">关闭</span></li>
    </ul>
    </div>
</div>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#c0de98" id=tables>
 <tr>
            <td height="26" colspan="4" background="<?php echo $this->_tpl_vars['sky_img']; ?>
images/admin_center/tab_14.gif" class="STYLE1"><span style="float:right; padding-right:50px;"><a href="javascript:void(0)" id="add">添加分类</a></span>&nbsp;&nbsp;<strong>新闻类型管理</strong></td>
          </tr>         
          <?php $_from = $this->_tpl_vars['style']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['val']):
?>
          <tr>
            <td width="7%" height="18" bgcolor="#FFFFFF" style="text-align:center; font-size:12px;"><?php echo $this->_tpl_vars['val']['style_id']; ?>
<input type="hidden" name="hide<?php echo $this->_tpl_vars['k']; ?>
" value="<?php echo $this->_tpl_vars['val']['style_name']; ?>
" id="hide<?php echo $this->_tpl_vars['k']; ?>
"><input type="hidden" name="id<?php echo $this->_tpl_vars['k']; ?>
" value="<?php echo $this->_tpl_vars['val']['style_id']; ?>
" id="id<?php echo $this->_tpl_vars['k']; ?>
"></td>
            <td width="65%" height="18" bgcolor="#FFFFFF" style="text-align:center; font-size:12px;" id='style<?php echo $this->_tpl_vars['k']; ?>
'><?php echo $this->_tpl_vars['val']['style_name']; ?>
</td>
            <td width="14%" height="18" bgcolor="#FFFFFF"><div align="center"><span class="STYLE2"><img src="<?php echo $this->_tpl_vars['sky_img']; ?>
images/admin_center/037.gif" width="9" height="9" /></span><span class="STYLE1"> [</span><a href="javascript:void(0)" id='edit<?php echo $this->_tpl_vars['k']; ?>
'>编辑</a><span class="STYLE1">]</span></div></td>
            <td width="14%" height="18" bgcolor="#FFFFFF"><div align="center"><span class="STYLE2"><img src="<?php echo $this->_tpl_vars['sky_img']; ?>
images/admin_center/010.gif" width="9" height="9" /></span><span class="STYLE2"> </span><span class="STYLE1">[</span><a href="#">删除</a><span class="STYLE1">]</span></div></td>
          </tr>
          <?php endforeach; endif; unset($_from); ?>
        </table>
</body>
</html>